<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>名片管理系统</title>
</head>
<body>
    <header th:fragment="header">
        <nav class="navbar navbar-expand-lg navbar-dark">
            <div class="container">
                <a class="navbar-brand" href="/">
                    <img src="/images/名片.svg" alt="名片图标" width="24" height="24" class="d-inline-block align-text-top mr-2"> 名片管理系统
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item">
                            <a class="nav-link btn-icon" href="/user/businesscard">
                                <i class="fa fa-folder-o"></i> 我的名片
                            </a>
                        </li>
                        <li class="nav-item ml-2">
                            <a class="nav-link btn-icon" href="/user/profile">
                                <i class="fa fa-user-o"></i> 个人中心
                            </a>
                        </li>
                    </ul>
                    <div class="navbar-text mr-3" th:if="${session.user != null}">
                        <i class="fa fa-user-circle-o mr-1"></i> 欢迎您，<span th:text="${session.user.username}" class="font-weight-bold">用户名</span>
                    </div>
                    <a class="btn btn-outline-light btn-icon" href="/user/logout">
                        <i class="fa fa-sign-out"></i> 退出登录
                    </a>
                </div>
            </div>
        </nav>
    </header>
</body>
</html>